import React from 'react';
import { Statistic } from 'antd';

export default class AreaDisplayer extends React.PureComponent {
  state = {};

  render() {
    const value = this.props.cellData;
    if (typeof value === 'object') {
      return value.map((element, index) =>
        (index === 0 ? (
          <Statistic precision={2} value={element} {...this.props} />
        ) : (
          <>
            / <Statistic precision={2} value={element} {...this.props} />
          </>
        )),
      );
    }
    return <Statistic precision={2} value={value} {...this.props} />;
  }
}
